package com.ynhenc.pta.routeRank.impl;

public class DurationChecker {
	
	public long checkNow() {
		if( then < 0 ) {
			return this.getCheckThen();
		} else {
			return this.getCheckNow();
		}
	}
	
	private long getCheckThen() {
		this.then = System.currentTimeMillis();
		return this.then;
	}
	
	private long getCheckNow() {
		this.now = System.currentTimeMillis();
		return this.now;
	}
	
	public double getDuration() {
		return ( this.now - this.then )/1000.0;
	}
	
	private long then = -1;
	private long now;

}
